<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/Widget/zTree/css/zTreeStyle/zTreeStyle.css}" type="text/css">
    <link th:href="@{/erp/Widget/icheck/icheck.css}" rel="stylesheet" type="text/css"/>
    <!--[if IE 7]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome-ie7.min.css}"/>
    <![endif]-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace-ie.min.css}"/>
    <![endif]-->
    <script th:src="@{/erp/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <!-- page specific plugin scripts -->
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/erp/js/H-ui.js}"></script>
    <script type="text/javascript" th:src="@{/erp/js/H-ui.admin.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>
    <script type="text/javascript" th:src="@{/erp/Widget/zTree/js/jquery.ztree.all-3.5.min.js}"></script>
    <script th:src="@{/erp/js/lrtk.js}" type="text/javascript"></script>
<title>自动分配</title>

</head>

<body>
	
<div class="margin clearfix">
 <div class="stystems_style">
  <div class="tabbable">
  <div class="page-content clearfix">
    <div id="Member_Ratings">
     <div class="d_Confirm_Order_style">
	<ul class="nav nav-tabs" id="myTab">
	  <li class="active">
		<a data-toggle="tab" href="#home"><i class="green fa fa-home bigger-110"></i>自动分配</a></li>
	</ul>
	</div>
	<div class="tab-content">	
			
	 <div id="home" class="tab-pane active">			
		 <!---->
		<div class="border clearfix">
        <span class="l_f">
        <a href="javascript:;" id="dayin" class="btn btn-success">确定打印</a>
        <a href="/laser/fp" class="btn btn-info">取消</a>
		</span>
		</div>
         <table class="table table-striped table-bordered table-hover sample-table" id="sample-table">
		<thead>
		 <tr>
				<th width="130">打印任务流水号</th>
				<th width="120">订单编号</th>
				<th width="170">组码</th>
                <th width="80">状态</th>
				<th width="100">打印机</th>
			</tr>
		</thead>
	<tbody>

      </tbody>
	</table>
	  自动分配闲时打印机
</div>
 </div>
 <!--添加用户图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
  
    <ul class=" page-content">
     <li><label class="label_name">打印任务流水号：</label><span class="add_name"><input value="" name="打印任务流水号" type="text"  class="text_add"/></span><div class="prompt r_f"></div></li>
     <li><label class="label_name">选择打印机：</label><span class="add_name">
     <label><input name="form-field-radio1" type="radio" checked="checked" class="ace"><span class="lbl">A1</span></label>
     <label><input name="form-field-radio1"type="radio" class="ace"><span class="lbl">A2</span></label></span></li>
     <div class="prompt r_f"></div>
     </li>
     <li><label class="label_name">订单编号：</label><span class="add_name"><input name="订单号" type="text"  class="text_add"/></span><div class="prompt r_f"></div></li>
      <li><label class="label_name">打印数量：</label><span class="add_name"><input name="打印数量" type="text"  class="text_add"/></span><div class="prompt r_f"></div></li>
	   <li><label class="label_name">调整人：</label><span class="add_name"><input name="调整人" type=""  class=""/></span><div class="prompt r_f"></div></li>
    </ul>
 </div>
 </div>
		</div>
		</div>
 </div>
</div>
</body>
</html>
<script>

jQuery(function($) {

    var table = $('#sample-table').dataTable({
        "autoWidth": false,//当重复刷新表格时，我的页面会出现变形的，现象，加了这个就好了
        searching: false,
        serverSide: true,   //开始服务器分页
        destroy:true,
        ajax: {
            url: '/laser/getserial',
            type: 'get',
            data: function (d) {
                var data = $('form').serialize(); //获取分页信息
                var searchParams = {
                    start: d.start,
                    length: d.length,
                };
                data = data + '&' + $.param(searchParams);
                return data;
            }
        },
        columnDefs: [{"defaultContent": "",
            "targets": "_all"}],
        columns: [

            {"data": "l_serial"},
            {"data": "l_no"},
            {"data": "l_code"},
            {"data": "l_status", "createdCell": function (td, cellData, rowData, row, col) {
                    console.log(cellData)
                    if (cellData == "1") {
                        $(td).empty().append("已打印");
                    } else if (cellData == "-1") {
                        $(td).empty().append('未打印');
                    }
                }
            },
            {"data": "l_printer", "createdCell": function (td, cellData, rowData, row, col) {

                    if (cellData =="") {
                        $(td).empty().append("无");
                    } else  {
                        $(td).empty().append(cellData);
                    }
                }},

        ]
    });


})

/*开始打印*/
 $('#dayin').on('click', function(){
    layer.open({
   title: '提示框'
   ,content: '您的打印任务已经提交给打印机，请查看打印情况，谢谢！'
});
     window.location.href="/laser/queding"

});



</script>
